package ipt.capitulo11;

import ipt.pru.f2.Alumno;

public class HiloOrdenaArray extends Thread{
	
	String id;
	static final String PATH_FILE = "C:/Users/ur00/workspace/EjerciciosClase/data/Alumnos.txt";
	static final int    FILE_SIZE = 10000;
	
	
	public HiloOrdenaArray(String id){
		super();
		this.id = id;
	}
	
	public void run(){
		System.out.println("Comienza hilo [" + id + "]");
		Alumno[] originalAlumno;
		Alumno[] ordenadoAlumno;
		originalAlumno = Alumno.inicializarTXTArray(PATH_FILE, FILE_SIZE);
		ordenadoAlumno = Alumno.ordenarArray(originalAlumno, 1);
		System.out.println("Fin hilo ["+ id + "]");
	}
	
	
	public static void main(String[] args) {
		
		HiloOrdenaArray hiloRapido = new HiloOrdenaArray("Rapido");
		HiloOrdenaArray hiloLento = new HiloOrdenaArray("Lento");
		
		hiloRapido.setPriority(Thread.MAX_PRIORITY);
		hiloLento.setPriority(Thread.MIN_PRIORITY);
		
		hiloLento.start();
		hiloRapido.start();
	}
}
